﻿<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>王梦雨 - 前端开发工程师</title>
    <style>
        /* CSS 变量 - 支持主题切换 */
        :root {
            --primary-color: #2a9d8f;
            --secondary-color: #264653;
            --text-color: #333;
            --bg-color: #fff;
            --card-bg: #f8f9fa;
            --border-color: #e9ecef;
            --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
            --transition: all 0.3s ease;
        }

        /* 暗色主题变量 */
        [data-theme="dark"] {
            --primary-color: #2a9d8f;
            --secondary-color: #e9c46a;
            --text-color: #f8f9fa;
            --bg-color: #212529;
            --card-bg: #343a40;
            --border-color: #495057;
            --shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
        }

        /* 基础样式重置 */
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }

        body {
            font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
            line-height: 1.6;
            color: var(--text-color);
            background-color: var(--bg-color);
            transition: var(--transition);
        }

        /* 布局容器 */
        .container {
            max-width: 1200px;
            margin: 0 auto;
            padding: 0 20px;
        }

        /* 头部样式 */
        .header {
            background-color: var(--primary-color);
            color: white;
            padding: 2rem 0;
            margin-bottom: 2rem;
        }

        .header__content {
            display: flex;
            justify-content: space-between;
            align-items: center;
            flex-wrap: wrap;
        }

        .header__info h1 {
            font-size: 2.5rem;
            margin-bottom: 0.5rem;
        }

        .header__info h2 {
            font-size: 1.5rem;
            font-weight: 400;
            opacity: 0.9;
        }

        .header__controls {
            display: flex;
            gap: 1rem;
        }

        /* 按钮样式 */
        .btn {
            padding: 0.5rem 1rem;
            border: none;
            border-radius: 4px;
            cursor: pointer;
            transition: var(--transition);
            font-weight: 500;
        }

        .btn--primary {
            background-color: var(--secondary-color);
            color: white;
        }

        .btn--primary:hover {
            transform: translateY(-2px);
            box-shadow: var(--shadow);
        }

        .btn--outline {
            background-color: transparent;
            border: 1px solid white;
            color: white;
        }

        .btn--outline:hover {
            background-color: rgba(255, 255, 255, 0.1);
        }

        /* 导航样式 */
        .nav {
            background-color: var(--card-bg);
            padding: 1rem 0;
            margin-bottom: 2rem;
            box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
        }

        .nav__list {
            display: flex;
            list-style: none;
            justify-content: center;
            flex-wrap: wrap;
        }

        .nav__item {
            margin: 0 1rem;
        }

        .nav__link {
            color: var(--text-color);
            text-decoration: none;
            font-weight: 500;
            padding: 0.5rem 0;
            position: relative;
            transition: var(--transition);
        }

        .nav__link:hover {
            color: var(--primary-color);
        }

        .nav__link::after {
            content: '';
            position: absolute;
            bottom: 0;
            left: 0;
            width: 0;
            height: 2px;
            background-color: var(--primary-color);
            transition: var(--transition);
        }

        .nav__link:hover::after {
            width: 100%;
        }

        /* 主要内容区域 */
        .main {
            display: grid;
            grid-template-columns: 1fr;
            gap: 2rem;
        }

        @media (min-width: 768px) {
            .main {
                grid-template-columns: 1fr 1fr;
            }
            
            .section--full {
                grid-column: 1 / -1;
            }
        }

        /* 卡片样式 */
        .card {
            background-color: var(--card-bg);
            border-radius: 8px;
            padding: 1.5rem;
            box-shadow: var(--shadow);
            transition: var(--transition);
            height: 100%;
        }

        .card:hover {
            transform: translateY(-5px);
            box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
        }

        .card__title {
            font-size: 1.5rem;
            margin-bottom: 1rem;
            color: var(--primary-color);
            display: flex;
            align-items: center;
        }

        .card__title::after {
            content: '';
            flex: 1;
            height: 1px;
            background-color: var(--border-color);
            margin-left: 1rem;
        }

        /* 联系信息样式 */
        .contact {
            display: flex;
            flex-direction: column;
            gap: 0.5rem;
        }

        .contact__item {
            display: flex;
            align-items: center;
            gap: 0.5rem;
        }

        .contact__icon {
            width: 20px;
            height: 20px;
            display: flex;
            align-items: center;
            justify-content: center;
            color: var(--primary-color);
        }

        /* 技能样式 */
        .skills {
            display: flex;
            flex-wrap: wrap;
            gap: 0.5rem;
        }

        .skill {
            background-color: var(--primary-color);
            color: white;
            padding: 0.3rem 0.8rem;
            border-radius: 20px;
            font-size: 0.9rem;
            transition: var(--transition);
        }

        .skill:hover {
            background-color: var(--secondary-color);
            transform: scale(1.05);
        }

        /* 项目样式 */
        .project {
            margin-bottom: 1.5rem;
            padding-bottom: 1.5rem;
            border-bottom: 1px solid var(--border-color);
        }

        .project:last-child {
            margin-bottom: 0;
            padding-bottom: 0;
            border-bottom: none;
        }

        .project__header {
            display: flex;
            justify-content: space-between;
            align-items: flex-start;
            margin-bottom: 0.5rem;
            flex-wrap: wrap;
        }

        .project__title {
            font-size: 1.2rem;
            font-weight: 600;
            color: var(--text-color);
        }

        .project__time {
            color: var(--primary-color);
            font-size: 0.9rem;
        }

        .project__description {
            margin-bottom: 0.5rem;
        }

        .project__tech {
            display: flex;
            flex-wrap: wrap;
            gap: 0.5rem;
            margin-bottom: 0.5rem;
        }

        .tech-tag {
            background-color: var(--secondary-color);
            color: white;
            padding: 0.2rem 0.5rem;
            border-radius: 4px;
            font-size: 0.8rem;
        }

        .project__links {
            display: flex;
            gap: 1rem;
        }

        .project__link {
            color: var(--primary-color);
            text-decoration: none;
            font-size: 0.9rem;
            display: flex;
            align-items: center;
            gap: 0.3rem;
            transition: var(--transition);
        }

        .project__link:hover {
            text-decoration: underline;
        }

        /* 教育样式 */
        .education {
            display: flex;
            flex-direction: column;
            gap: 1rem;
        }

        .education__item {
            display: flex;
            justify-content: space-between;
            align-items: flex-start;
            flex-wrap: wrap;
        }

        .education__details {
            flex: 1;
        }

        .education__school {
            font-weight: 600;
            margin-bottom: 0.2rem;
        }

        .education__degree {
            color: var(--primary-color);
        }

        .education__year {
            color: var(--text-color);
            opacity: 0.7;
        }

        /* 表单样式 */
        .form {
            display: flex;
            flex-direction: column;
            gap: 1rem;
        }

        .form__group {
            display: flex;
            flex-direction: column;
            gap: 0.5rem;
        }

        .form__label {
            font-weight: 500;
        }

        .form__input,
        .form__textarea {
            padding: 0.8rem;
            border: 1px solid var(--border-color);
            border-radius: 4px;
            background-color: var(--bg-color);
            color: var(--text-color);
            transition: var(--transition);
        }

        .form__input:focus,
        .form__textarea:focus {
            outline: none;
            border-color: var(--primary-color);
            box-shadow: 0 0 0 2px rgba(42, 157, 143, 0.2);
        }

        .form__textarea {
            min-height: 120px;
            resize: vertical;
        }

        .form__error {
            color: #e76f51;
            font-size: 0.8rem;
            display: none;
        }

        /* 页脚样式 */
        .footer {
            background-color: var(--card-bg);
            padding: 2rem 0;
            margin-top: 3rem;
            text-align: center;
            border-top: 1px solid var(--border-color);
        }

        .footer__text {
            color: var(--text-color);
            opacity: 0.7;
            font-size: 0.9rem;
        }

        /* 打印样式 */
        @media print {
            .header__controls,
            .nav,
            .footer,
            .form-container {
                display: none !important;
            }
            
            .card {
                box-shadow: none;
                border: 1px solid #ddd;
            }
            
            body {
                background-color: white;
                color: black;
            }
            
            .header {
                background-color: #2a9d8f !important;
                color: white !important;
                -webkit-print-color-adjust: exact;
            }
            
            .card__title {
                color: #2a9d8f !important;
            }
            
            .skill, .tech-tag {
                background-color: #2a9d8f !important;
                color: white !important;
                -webkit-print-color-adjust: exact;
            }
            
            a {
                color: #2a9d8f !important;
                text-decoration: underline;
            }
            
            a[href]:after {
                content: " (" attr(href) ")";
            }
        }

        /* 响应式设计 */
        @media (max-width: 767px) {
            .header__content {
                flex-direction: column;
                text-align: center;
                gap: 1rem;
            }
            
            .nav__list {
                flex-direction: column;
                gap: 0.5rem;
            }
            
            .project__header {
                flex-direction: column;
                gap: 0.5rem;
            }
            
            .education__item {
                flex-direction: column;
                gap: 0.5rem;
            }
        }
    </style>
</head>
<body>
    <!-- 页面头部 -->
    <header class="header">
        <div class="container">
            <div class="header__content">
                <div class="header__info">
                    <h1>王梦雨</h1>
                    <h2>前端开发工程师</h2>
                </div>
                <div class="header__controls">
                    <button id="theme-toggle" class="btn btn--outline">切换主题</button>
                    <button id="print-btn" class="btn btn--primary">打印简历</button>
                </div>
            </div>
        </div>
    </header>

    <!-- 导航 -->
    <nav class="nav">
        <div class="container">
            <ul class="nav__list">
                <li class="nav__item"><a href="#about" class="nav__link">个人简介</a></li>
                <li class="nav__item"><a href="#skills" class="nav__link">技能</a></li>
                <li class="nav__item"><a href="#projects" class="nav__link">项目经验</a></li>
                <li class="nav__item"><a href="#education" class="nav__link">教育背景</a></li>
                <li class="nav__item"><a href="#certificates" class="nav__link">证书与竞赛</a></li>
                <li class="nav__item"><a href="#contact" class="nav__link">联系方式</a></li>
            </ul>
        </div>
    </nav>

    <!-- 主要内容 -->
    <main class="container main">
        <!-- 个人简介 -->
        <section id="about" class="section--full">
            <div class="card">
                <h2 class="card__title">个人简介</h2>
                <p>热爱前端开发，具备扎实的HTML、CSS和JavaScript基础，熟悉现代前端框架Vue和React。注重代码质量和用户体验，持续学习新技术并应用于实际项目中。具备良好的团队协作能力和解决问题的能力，期待在前端开发领域不断成长。</p>
            </div>
        </section>

        <!-- 联系方式 -->
        <section id="contact-info">
            <div class="card">
                <h2 class="card__title">联系方式</h2>
                <div class="contact">
                    <div class="contact__item">
                        <span class="contact__icon">📧</span>
                        <span>邮箱：your-email@example.com</span>
                    </div>
                    <div class="contact__item">
                        <span class="contact__icon">📱</span>
                        <span>电话：138-XXXX-XXXX</span>
                    </div>
                    <div class="contact__item">
                        <span class="contact__icon">🔗</span>
                        <span>GitHub：github.com/yourusername</span>
                    </div>
                    <div class="contact__item">
                        <span class="contact__icon">🌐</span>
                        <span>作品集：your-portfolio.com</span>
                    </div>
                </div>
            </div>
        </section>

        <!-- 技能 -->
        <section id="skills">
            <div class="card">
                <h2 class="card__title">技能</h2>
                <div class="skills">
                    <span class="skill">HTML5</span>
                    <span class="skill">CSS3</span>
                    <span class="skill">JavaScript</span>
                    <span class="skill">Vue.js</span>
                    <span class="skill">React</span>
                    <span class="skill">TypeScript</span>
                    <span class="skill">Webpack</span>
                    <span class="skill">Git</span>
                    <span class="skill">响应式设计</span>
                    <span class="skill">UI/UX设计</span>
                    <span class="skill">Node.js</span>
                    <span class="skill">RESTful API</span>
                </div>
            </div>
        </section>

        <!-- 项目经验 -->
        <section id="projects" class="section--full">
            <div class="card">
                <h2 class="card__title">项目经验</h2>
                
                <div class="project">
                    <div class="project__header">
                        <h3 class="project__title">在线电商平台前端开发</h3>
                        <span class="project__time">2023.03 - 2023.08</span>
                    </div>
                    <p class="project__description">负责电商平台前端页面的设计与实现，包括商品列表、商品详情、购物车和订单管理模块。</p>
                    <div class="project__tech">
                        <span class="tech-tag">Vue.js</span>
                        <span class="tech-tag">Vuex</span>
                        <span class="tech-tag">Element UI</span>
                        <span class="tech-tag">Axios</span>
                    </div>
                    <p><strong>项目亮点：</strong>实现了响应式设计，优化了页面加载速度，提升了用户体验；使用Vuex进行状态管理，提高了代码可维护性。</p>
                    <div class="project__links">
                        <a href="#" class="project__link">🔗 项目演示</a>
                        <a href="#" class="project__link">📂 源码仓库</a>
                    </div>
                </div>
                
                <div class="project">
                    <div class="project__header">
                        <h3 class="project__title">企业官网重构与优化</h3>
                        <span class="project__time">2022.09 - 2022.12</span>
                    </div>
                    <p class="project__description">对现有企业官网进行重构，采用现代化前端技术栈，提升网站性能和用户体验。</p>
                    <div class="project__tech">
                        <span class="tech-tag">React</span>
                        <span class="tech-tag">TypeScript</span>
                        <span class="tech-tag">Styled Components</span>
                        <span class="tech-tag">Webpack</span>
                    </div>
                    <p><strong>项目亮点：</strong>引入TypeScript提高代码质量；使用Styled Components实现组件化样式；通过代码分割和懒加载优化首屏加载时间。</p>
                    <div class="project__links">
                        <a href="#" class="project__link">🔗 项目演示</a>
                        <a href="#" class="project__link">📂 源码仓库</a>
                    </div>
                </div>
            </div>
        </section>

        <!-- 教育背景 -->
        <section id="education">
            <div class="card">
                <h2 class="card__title">教育背景</h2>
                <div class="education">
                    <div class="education__item">
                        <div class="education__details">
                            <div class="education__school">湖南农业大学</div>
                            <div class="education__degree">计算机科学与技术 本科</div>
                        </div>
                        <div class="education__year">{graduation_year}</div>
                    </div>
                </div>
            </div>
        </section>

        <!-- 证书与竞赛 -->
        <section id="certificates">
            <div class="card">
                <h2 class="card__title">证书与竞赛</h2>
                <ul>
                    <li>全国大学生计算机设计大赛 - 省级二等奖 (2022)</li>
                    <li>前端开发工程师认证 (2021)</li>
                    <li>英语六级证书 (2020)</li>
                    <!-- 添加更多证书或竞赛 -->
                </ul>
            </div>
        </section>

        <!-- 联系表单 -->
        <section id="contact" class="section--full form-container">
            <div class="card">
                <h2 class="card__title">联系我</h2>
                <form class="form" id="contact-form">
                    <div class="form__group">
                        <label for="name" class="form__label">姓名</label>
                        <input type="text" id="name" class="form__input" required>
                        <div class="form__error" id="name-error">请输入您的姓名</div>
                    </div>
                    <div class="form__group">
                        <label for="email" class="form__label">邮箱</label>
                        <input type="email" id="email" class="form__input" required>
                        <div class="form__error" id="email-error">请输入有效的邮箱地址</div>
                    </div>
                    <div class="form__group">
                        <label for="message" class="form__label">留言</label>
                        <textarea id="message" class="form__textarea" required></textarea>
                        <div class="form__error" id="message-error">请输入留言内容</div>
                    </div>
                    <button type="submit" class="btn btn--primary">发送消息</button>
                </form>
            </div>
        </section>
    </main>

    <!-- 页脚 -->
    <footer class="footer">
        <div class="container">
            <p class="footer__text">© 2023 王梦雨 - 前端开发工程师</p>
            <p class="footer__text">最后更新: 2023年10月</p>
            <p class="footer__text" style="margin-top: 1rem; font-size: 0.8rem;">
                如何修改: 替换联系方式占位符、更新项目经验、修改教育信息中的{graduation_year}、根据需要添加更多证书或项目。
            </p>
        </div>
    </footer>

    <script>
        // 主题切换功能
        const themeToggle = document.getElementById('theme-toggle');
        const currentTheme = localStorage.getItem('theme') || 'light';
        
        // 设置初始主题
        document.documentElement.setAttribute('data-theme', currentTheme);
        
        // 切换主题
        themeToggle.addEventListener('click', () => {
            const currentTheme = document.documentElement.getAttribute('data-theme');
            const newTheme = currentTheme === 'light' ? 'dark' : 'light';
            
            document.documentElement.setAttribute('data-theme', newTheme);
            localStorage.setItem('theme', newTheme);
        });
        
        // 打印功能
        document.getElementById('print-btn').addEventListener('click', () => {
            window.print();
        });
        
        // 表单验证
        document.getElementById('contact-form').addEventListener('submit', function(e) {
            e.preventDefault();
            
            let isValid = true;
            
            // 验证姓名
            const name = document.getElementById('name');
            const nameError = document.getElementById('name-error');
            if (!name.value.trim()) {
                nameError.style.display = 'block';
                isValid = false;
            } else {
                nameError.style.display = 'none';
            }
            
            // 验证邮箱
            const email = document.getElementById('email');
            const emailError = document.getElementById('email-error');
            const emailRegex = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
            if (!emailRegex.test(email.value)) {
                emailError.style.display = 'block';
                isValid = false;
            } else {
                emailError.style.display = 'none';
            }
            
            // 验证留言
            const message = document.getElementById('message');
            const messageError = document.getElementById('message-error');
            if (!message.value.trim()) {
                messageError.style.display = 'block';
                isValid = false;
            } else {
                messageError.style.display = 'none';
            }
            
            // 如果验证通过，显示成功消息（实际应用中应发送到服务器）
            if (isValid) {
                alert('消息发送成功！');
                this.reset();
            }
        });
        
        // 平滑滚动
        document.querySelectorAll('.nav__link').forEach(link => {
            link.addEventListener('click', function(e) {
                e.preventDefault();
                
                const targetId = this.getAttribute('href');
                const targetElement = document.querySelector(targetId);
                
                window.scrollTo({
                    top: targetElement.offsetTop - 100,
                    behavior: 'smooth'
                });
            });
        });
    </script>
</body>
</html>